package com.godz.controller;

import com.godz.mapper.*;
import com.godz.pojo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class indexController {
    @Autowired
    GodzEduMapper godzEduMapper;
    @Autowired
    GodzGodMapper godzGodMapper;
    @Autowired
    GodzIndexMapper godzIndexMapper;
    @Autowired
    GodzJobMapper godzJobMapper;
    @Autowired
    GodzPosMapper godzPosMapper;
    @Autowired
    GodzTitleMapper godzTitleMapper;
    @Autowired
    HfuuLifeMapper hfuuLifeMapper;

    @RequestMapping(value={"/","/index"})
    public String index(Model model){
        //标题栏数据
        List<GodzTitle> titles = godzTitleMapper.selectList(null);
        model.addAttribute("title",titles);
        //首页数据
        GodzIndex godzIndex = godzIndexMapper.selectOne(null);
        model.addAttribute("godzindex",godzIndex);
        //身份数据
        List<GodzPos> pos = godzPosMapper.selectList(null);
        model.addAttribute("pos",pos);
        //技能百分比
        List<GodzGod> god = godzGodMapper.selectList(null);
        model.addAttribute("god",god);
        //就职经历
        List<GodzJob> jobs = godzJobMapper.selectList(null);
        model.addAttribute("jobs",jobs);
        //大学经历
        List<HfuuLife> hfuuLives = hfuuLifeMapper.selectList(null);
        model.addAttribute("hfuuLives",hfuuLives);
        //教育背景
        List<GodzEdu> edus = godzEduMapper.selectList(null);
        model.addAttribute("edus",edus);
        return "index";
    }

    
}
